package com.abluedog.util;

import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.math.random.Random;

import java.util.ArrayList;


public class PrizePool {

    private static final PrizePool prizePoolInstance = new PrizePool();

    private final ArrayList<Item> stoneToolPrizePoll = new ArrayList<>();

    private final ArrayList<Item> ironToolPrizePoll = new ArrayList<>();

    private final ArrayList<Item> diamondToolPrizePoll = new ArrayList<>();

    public PrizePool() {
        stoneToolPrizePoll.add(Items.COAL);
        stoneToolPrizePoll.add(Items.FLINT);
        ironToolPrizePoll.add(Items.GOLD_NUGGET);
        ironToolPrizePoll.add(Items.IRON_NUGGET);
        diamondToolPrizePoll.add(Items.GOLD_INGOT);
        diamondToolPrizePoll.add(Items.IRON_INGOT);
    }

    public static PrizePool getInstance() {
        return prizePoolInstance;
    }

    public Item getStonePrize(Random random) {
        return stoneToolPrizePoll.get(random.nextInt(stoneToolPrizePoll.size()));
    }

    public Item getIronPrize(Random random) {
        return ironToolPrizePoll.get(random.nextInt(ironToolPrizePoll.size()));
    }

    public Item getDiamondPrize(Random random) {
        return diamondToolPrizePoll.get(random.nextInt(diamondToolPrizePoll.size()));
    }
}
